package com.jzr.bedside.ui.adapter

import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.BaseViewHolder
import com.inuker.bluetooth.library.search.SearchResult
import com.jzr.bedside.R
import com.jzr.bedside.bean.DrugDataBean
import com.jzr.bedside.bean.MediaListBean

class DeviceAdapter(data: MutableList<SearchResult>?) :
        BaseQuickAdapter<SearchResult, BaseViewHolder>(
            R.layout.item_device,
            data
        ) {


        override fun convert(helper: BaseViewHolder?, item: SearchResult?) {
            helper?.setText(R.id.tvDeviceName,item?.name)
            helper?.setText(R.id.tvDeviceMac,item?.address)

            helper?.itemView?.setOnClickListener{
                onItemClick?.onListItemClick(item)
            }
        }

    private var onItemClick: onListItemClick? = null

    interface onListItemClick {
        fun onListItemClick(item: SearchResult?)
    }

    fun onListItemClick(onListItemClick: onListItemClick?) {
        this.onItemClick = onListItemClick
    }



}